import {setFolderChildren} from './action_creators';
export default function remoteActionMiddleware({ getState, dispatch }) {
	return next => action => {
		switch (action.type) {       
        	case 'SET_CUR_FOLDER_ID':
			{
				var folderId = action.folderId;
				CMISService.getFolderChildren(folderId)
					.done(function(response) {
						dispatch(setFolderChildren(folderId, response.data));
					})
				break;
			}
		}
		return next(action);
	}
}